
package com.idealighter.game.games.wknh.struct;

import com.idealighter.game.games.common.AbstractSeat;
import com.idealighter.game.games.common.buyu.Bullet;

import java.util.HashMap;
import java.util.Map;

/**
 * 悟空闹海seat .
 * 
 * @date 2016年3月7日 下午8:58:56
 *
 */
public class WknhSeat extends AbstractSeat {
  // 所属桌子
  public final WknhTable table;
  // 炮管id
  public int batteryId = 1;
  // 是否能量炮
  public boolean power = false;
  // 子弹id种子
  public int bulletSeed = 1;
  // 玩家发出的子弹，如果为负则是能量炮子弹
  public Map<Integer, Bullet> bullets = new HashMap<>();
  // 玩家赢得筹码
  public long winChips = 0;

  /**
   * 构造函数 .
   * 
   * @param order .
   * @param table .
   */
  public WknhSeat(int order, WknhTable table) {
    super(order);
    this.table = table;
  }

  /**
   * 清空座位数据 .
   */
  public void clear() {
    this.playerId = 0;
    this.playerName = null;
    this.totalChips = 0;
    this.winChips = 0;
    this.batteryId = 1;
    this.power = false;
    this.bulletSeed = 1;
    this.bullets.clear();
  }

  @SuppressWarnings("unchecked")
  @Override
  public WknhTable table() {
    return table;
  }
}
